import React from 'react'
import { type NativeProps, withNativeProps } from '../../utils/native-props'
import './index.scss'

const classPrefix = 'rt-auto-center'

export type AutoCenterProps = { children?: React.ReactNode } & NativeProps

export const AutoCenter: React.FC<AutoCenterProps> = (props) => withNativeProps(
  props,
  <div className={classPrefix}>
    <div className={`${classPrefix}-content`}>{props.children}</div>
  </div>,
)
